<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>没有slot的组件显示提示信息</title>
</head>
<body>
    <div id="app">
        <ele></ele>
        <ele>
            <div>这个是一个组件</div>
        </ele>
    </div>
    <script src="./utils/vue.min.js"></script>
    <script>
        Vue.component('ele',{
            render: function (createElement) {
                if(this.$slots.default === undefined){
                    return createElement('div','没有可以显示的内容！');
                }else
                {
                    console.dir(this.$slots.default);
                    return createElement('div',this.$slots.default);
                }
            }
        });

        var app = new Vue({
            el: '#app'
        });
    </script>
</body>
</html>